﻿@namespace BlazorFluentUI
@inherits FluentUIComponentBase
@using Microsoft.AspNetCore.Components.Web

<LocalCS @bind-Rules="@DocumentCardImageRules" />

<div class=@($"{RootRule.Selector?.SelectorName} {ClassName}") style="@Style" @ref="RootElementReference">
    @if (!string.IsNullOrWhiteSpace(ImageSource))
    {
        <Image Height="@Height" Width="@Width" ImageFit="@ImageFit" Src="@ImageSource" Role="presentation" Alt="" OnLoadingStateChange="LoadStateChanged"></Image>
        @if (ImageLoaded)
        {
            <div class="@CenteredIconWrapperRule.Selector?.SelectorName">
                <Icon ClassName="@CenteredIconRule.Selector?.SelectorName" IconName="@IconName" IconSrc=@IconSrc></Icon>
            </div>
        }
        else
        {
            <Icon ClassName="@CornerIconRule.Selector?.SelectorName" IconName="@IconName" IconSrc=@IconSrc></Icon>
        }
    }
</div>